<?php
	if ($mod=="subscribe_news"){
		if ($act == 'del_mas') {
			$del_mas = array();
			if (isset($_GET["ids"])) $del_mas=$_GET["ids"];
			elseif (isset($_POST["ids"])) $del_mas=$_POST["ids"];
			if (count($del_mas) > 0){
				$subscribe_newsclass->emails_del($del_mas);
			}
		} elseif ($act == 'add') {
			$data = array();
			if (isset($_POST["subscribe_news_email"]) && (strlen($_POST["subscribe_news_email"]) > 0)){
				$res = $subscribe_newsclass->add_new_registation($_POST["subscribe_news_email"]);
				if ($res != 1) $err->AddError($res);
			} else $err->AddError(13);
		} elseif ($act == 'export') {
			$subscribe_newsclass->emails_export();
		} elseif ($act == 'export_un') {
			$subscribe_newsclass->emails_export_unsubscribers();
		}
	} elseif ($mod=="search"){
		$subscribers = array();
		if (!isset($_GET['query'])) $query=NULL; else $query=$_GET['query'];
		if ($query==NULL) if (!isset($_POST['query'])) $query=NULL; else $query=$_POST['query'];
		if ($query!=NULL) $subscribers = $subscribe_newsclass->get_subscribers_by_search($query);
		$data['subscribers_search'] = $subscribers;
	}

?>